package com.changgou.item.controller;

import com.changgou.item.service.PageService;
import com.changgou.util.Result;
import com.changgou.util.StatusCode;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author tang.qingbo
 * @Date 2020/8/30 23:22
 * @Version 1.0
 */
@RestController
@RequestMapping("/page")
public class PageController {
    @Autowired
    private PageService pageService;

    @GetMapping("/createHtml/{id}")
    public Result createHtml(@PathVariable("id") String spuId) {
        pageService.createPageHtml(spuId);
        return new Result(true, StatusCode.OK, "静态页面生成成功!");
    }
}
